using CodeSnippet.Formats.Base;

namespace CodeSnippet.Formats
{
    /// <summary>
    /// Generates color-coded HTML 4.01 from Regex syntax.
    /// </summary>
    internal class RegexFormat : CodeFormat
    {
        #region Properties
        /// <summary>
        /// Single Line
        /// </summary>
        protected override string CommentRegex
        {
            get { return @"(?:\(?\??\#[^)\r\n]+\)?)"; }
        }
        /// <summary>
        /// Overridden to capture the named capture groups.
        /// </summary>
        /// <remarks>
        /// The text will be converted to html escape codes.
        /// </remarks>
        protected override string StringRegex
        {
            get { return @"(?<=\(\?&lt;)([^&]+)(?=&gt;)"; }
        }
        protected override string Keywords
        {
            get { return @"\?&lt;=? &lt; &gt; \?[:!=]"; }
        }
        protected override string AttributesRegex
        {
            get { return @"(\\[sSDdWw])|([.])"; }
        }
        protected override string ClassRegex
        {
            get { return @"(\\[zZBbGA])|(\\&lt;)|(\\&gt;)|([\^$?*])"; }
        }
        /// <summary>
        /// Determines if the language is case sensitive.
        /// </summary>
        /// <value>
        /// Returns <b>false</b>, since regex is not case sensitive.
        /// </value>
        public override bool CaseSensitive
        {
            get { return false; }
        }
        #endregion Properties
    }
}